//
//  WFAboutUsViewController.m
//  FAKER
//
//  Created by Jianwei on 15/11/16.
//  Copyright © 2015年 YHLai. All rights reserved.
//

#import "WFAboutUsViewController.h"
#import "WFWeiboViewController.h"
#import "AllHeader.h"
#import "FitHeader.h"
#define WFUrlString @"http://weibo.com/u/5290447258"
#define LQYUrlString @"http://weibo.com/u/3260358984"
#define LYHUrlString @"http://weibo.com/u/3861373848"
@interface WFAboutUsViewController ()
@property(nonatomic, strong)UILabel *WFLabel;
@property(nonatomic, strong)UILabel *LYHLabel;
@property(nonatomic, strong)UILabel *LQYLabel;
@property(nonatomic, strong)NSArray *urlArray;
@end

@implementation WFAboutUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor greenColor];
    if (NSUSERDEFAULTS_NIGHT) {
        self.view.backgroundColor = [UIColor blackColor];
    }
}
- (void)viewWillDisappear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden = 0;
}
- (void)pushViewController:(UITapGestureRecognizer *)tap
{
        WFWeiboViewController *wc = [[WFWeiboViewController alloc]initWithURL:[NSURL URLWithString:_urlArray[tap.view.tag - 1000]]];
        [wc setHidesBottomBarWhenPushed:1];
        [self.navigationController pushViewController:wc animated:1];
}
- (void)loadView
{
    [super loadView];
    _urlArray = @[WFUrlString, LYHUrlString, LQYUrlString];
    
    self.navigationController.navigationBar.hidden = 1;
    NSArray *nameArray = @[@"王健伟", @"赖艺航", @"兰庆禹"];
    NSMutableArray *labelArray = [NSMutableArray array];
    
    for (NSInteger i = 0; i < 3; i++) {
        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(100, 200 + 100 * i, 175, 50)];
        label.userInteractionEnabled = 1;
        label.tag = 1000 + i;
        label.backgroundColor = [UIColor redColor];
        if (NSUSERDEFAULTS_NIGHT) {
            label.backgroundColor = [UIColor lightGrayColor];
        }
        label.textAlignment = 1;
        label.font = [UIFont systemFontOfSize:20];
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(pushViewController:)];
        [label addGestureRecognizer:tap];
        label.text = nameArray[i];
        [labelArray addObject:label];
        
    }
    _WFLabel = labelArray[0];
    _LYHLabel = labelArray[1];
    _LQYLabel = labelArray[2];
    
    [self.view addSubview:_WFLabel];
    [self.view addSubview:_LYHLabel];
    [self.view addSubview:_LQYLabel];
    
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
